/**
 * Created by Administrator on 2017/2/12.
 */
import { Component } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import {FacdetailService } from './factdetail.serve';

@Component({
  moduleId: module.id,
  selector: 'my-facdetail',
  templateUrl: 'facdetail.html',
  providers:[ FacdetailService ]
})
export class FacdetailComponent {

  constructor(
      private route: ActivatedRoute,
      private router: Router,
      private FacdetailService:FacdetailService,
  ) {}

  private inf='';
  private id='';
  private falist='';
  private errorMessage='';
  private delet=false;
  delelt1(){
    this.delet=true
  }
  delelt2(){
    this.delet=false
  }

  ngOnInit() {
    this.route.params
        .subscribe((params: Params) => {
          this.inf = params['facname'];
          this.id = params['id'];
        });
    let giveid = this.id;
    this.FacdetailService.faclist(giveid)
        .subscribe(
            res=>{
              this.falist=res;
              console.log(this.falist)
            },
            error =>this.errorMessage = <any>error
        )
  }

  moreLink =false;
  more(){
    if (this.moreLink==true){
      this.moreLink=false
    }else {
      this.moreLink=true
    }
  }
}
